//Page Object
import request from "../../request/request.js"
Page({
  data: {
      swiperList:[],
      cateList:[],
      floorList:[]
  },
  //options(Object)
  onLoad: function(options) {
      wx.request({
        url:"https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata",
        success:(result)=>{
          this.setData({
            swiperList:result.data.message
          })
        }
      }),
      request({url:"https://api-hmugo-web.itheima.net/api/public/v1/home/catitems"}).then(result=>{
        console.log(result.data)
        this.setData({
          cateList:result.data.message
        })
      }),
      request({url:"https://api-hmugo-web.itheima.net/api/public/v1/home/floordata"})
      .then((result)=>{
        this.setData({
          floorList:result.data.message
        })
      })
  },
  onReady: function() {
    // wx.request({
    //   url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
    //   success:(res)=>{
    //     console.log(res.data.message)
    //     this.setData({imageList:res.data.message}

    //     )
    //   }
    // })
  },
  onShow: function() {
    
  },
  onHide: function() {

  },
  onUnload: function() {

  },
  onPullDownRefresh: function() {

  },
  onReachBottom: function() {

  },
  onShareAppMessage: function() {

  },
  onPageScroll: function() {

  },
  //item(index,pagePath,text)
  onTabItemTap:function(item) {

  }
});
  